<?php

namespace app\model\iot_model;

use app\BaseModel;
use app\model\UserModel;
use think\model\relation\BelongsTo;

class IotRoomReservationBlacklist extends BaseModel
{
    protected $name = 'iot_room_reservation_blacklist';

    /**
     * 用户
     * @return BelongsTo
     */
    public function user(): BelongsTo
    {
        return $this->belongsTo(UserModel::class,'uid')->bind([
            'user_name' => 'name',
            'avatar'
        ]);
    }

    /**
     * 操作人
     * @return BelongsTo
     */
    public function operator(): BelongsTo
    {
        return $this->belongsTo(UserModel::class,'operator_uid')->bind([
            'operator_name' => 'name',
        ]);
    }
}